import { Renderer } from "../engine";
import { Behaviour } from "../engine/Behaviour";
import { Rectangle } from "../engine/math";
import { number } from "../engine/validators/number";
import { string } from "../engine/validators/string";

export class ShapeRectRenderer extends Behaviour implements Renderer {

    @number()
    width = 100;
    @number()
    height = 100;
    @string()
    color = 'red';

    onStart(): void {
        this.gameObject.renderer = this;
    }

    getBounds(): Rectangle {
        return {
            x: 0,
            y: 0,
            width: this.width,
            height: this.height
        };
    }
}